Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: L1 <> L2 messaging with Token Bridge example #253

Open
wants to merge 35 commits into
base: dev
Choose a base branch
from

Conversation

0xNeshi
Copy link
Contributor

@0xNeshi 0xNeshi commented Oct 23, 2024

Issue(s): Close #186

Description

Adds a simple token bridge example that sends and receives tokens from L1 to L2 and vice versa.

Checklist

@0xNeshi 0xNeshi changed the title L1 l2 token bridge Feature: L1 <> L2 messaging with Token Bridge example Oct 23, 2024
@@ -0,0 +1 @@
src/Vm.sol linguist-generated
Copy link
Contributor Author

@0xNeshi 0xNeshi Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of notes/questions:

  • I added tests for the Solidity contracts to ensure correctness, and opted for Foundry for consistency (as we already use it for Starknet contract tests). If you think this adds too many other files (see next point), and don't think they're that necessary for this example, we can delete.
  • forge-std library is included in the source, as it makes any extra setup unnecessary to run tests for the Solidity TokenBridge in the future. Let me know if you want this removed, and we can add a README note with instructions on how to set this up.
  • I didn't update ./scripts/cairo_programs_verifier.sh to run Solidity tests, but this can be done.

import "starknet/IStarknetMessaging.sol";

/**
* @title Contract to bridge tokens to and from Starknet. Has basic access control
Copy link
Contributor Author

@0xNeshi 0xNeshi Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if you want me to remove some of these comments, I aimed for a contract that respects best dev practices, but not sure if it adds too much clutter to the code on the website.

@julio4 julio4 self-assigned this Oct 24, 2024
@julio4 julio4 changed the base branch from main to dev November 20, 2024 03:25
@julio4
Copy link
Contributor

julio4 commented Nov 20, 2024

@0xNeshi The repository has been upgraded to a new site generator and the Markdown format to include code listings is slightly different. The CONTRIBUTING guidelines has been updated to reflect these changes.
Could you rebase this PR onto dev. If there's any issues or if you want me to do these changes let me know.

@0xNeshi
Copy link
Contributor Author

0xNeshi commented Dec 7, 2024

@julio4 updated the branch!

Took the liberty to update Scarb.toml examples in CONTRIBUTING.md, I think they were missing the edition.workspace = true field. Also updated the typos src/ example to be typos pages/, as I think this makes more sense given the current setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: L1 <> L2 messaging with Bridge example
2 participants